const express = require('express')
const userController = require('../controller/user')
const router = express.Router()

// test
// router.get('/', (req, res) => {
//   res.send('Hello World!')
// })

// 注册用户
router.post('/users', userController.register)

// 获取用户列表
router.get('/users', userController.getUserList)

// 根据id获取用户
router.get('/user/:id', userController.getUserByID)

// 根据id修改用户
router.patch('/user/:id', userController.updateUserByID)

// 根据id删除用户
router.delete('/user/:id', userController.deleteUserByID)

module.exports = router
